package com.ruoyi.teacher.service.impl;

import com.ruoyi.teacher.domain.Type;
import com.ruoyi.teacher.mapper.TypeDto;
import com.ruoyi.teacher.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeDto typeDto;

    @Override
    public List<Type> getList() {
        return typeDto.findAll();
    }

    @Override
    public Type getById(Long id) {
        Optional<Type> byId = typeDto.findById(id);
        return byId.get();
    }
}
